package com.myapi.client.DAO;


import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.myapi.client.PlayerHandDAO;




@PersistenceCapable
public class CardDAO implements Serializable{
	   @PrimaryKey      
	     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
		     private Key CId;
	   @Persistent
	 private Key key;
	@Persistent
	public static final String SPADE = "Spade";
	@Persistent
	public static final String HEART = "Heart";
	@Persistent
	public static final String CLUB = "Club";
	@Persistent
	public static final String DIAMOND = "Diamond";
	
	@Persistent
	Set<Key> keyPlayerHand;
	
	@Persistent
	private int value;  //2 = 2, Jack = 11, Queen = 12, King = 13, Ace = 14
	@Persistent
	private String suit;
	
	public CardDAO(){
		keyPlayerHand=new HashSet<Key>();
		
	}

	public int getValue() {
		return value;
	}

	public void setValue(int value) {
		this.value = value;
	}

	public String getSuit() {
		return suit;
	}

	public void setSuit(String suit) {
		this.suit = suit;
	}

	public Key getKey(){
		return key;
	}
	public void addtKeyPlayerHand(PlayerHandDAO phi){
		keyPlayerHand.add(phi.getKey());
	}
	
	
}
